/*
 * @Description: 设备管理
 * @Author: Wang ZhongWang
 * @Date: 2022-02-20 10:11:35
 * @LastEditTime: 2022-02-20 10:49:55
 * @LastEditors: Wang ZhongWang
 */

import request from '@/utils/request'

export function getAllDeviceInfo(query) {
  return request({
    url: '/winglinks/link/device/selectAllDeviceInfo',
    method: 'get',
    params: query
  })
}

export function getPageDeviceInfo(query) {
  return request({
    url: '/winglinks/link/device/selectPageDeviceInfo',
    method: 'get',
    params: query
  })
}

export function connectStatusStatistic(query) {
  return request({
    url: '/winglinks/link/device/connectStatusStatistic',
    method: 'get',
    params: query
  })
}

export function deviceTypeStatistic(query) {
  return request({
    url: '/winglinks/link/device/deviceTypeStatistic',
    method: 'get',
    params: query
  })
}

export function deviceStatusStatistic(query) {
  return request({
    url: '/winglinks/link/device/deviceStatusStatistic',
    method: 'get',
    params: query
  })
}

export function getListPage(query) {
  return request({
    url: '/winglinks/link/device/list',
    method: 'get',
    params: query
  })
}

export function getDeviceById(id) {
  return request({
    url: '/winglinks/link/device/' + id,
    method: 'get'
  })
}

export function addDevice(query) {
  return request({
    url: '/winglinks/link/device/add',
    method: 'post',
    data: query
  })
}

export function updateDevice(query) {
  return request({
    url: '/winglinks/link/device',
    method: 'put',
    data: query
  })
}

export function deleteDevice(id) {
  return request({
    url: '/winglinks/link/device/' + id,
    method: 'delete'
  })
}

export function validationFindOneByDeviceIdentification(deviceIdentification) {
  return request({
    url: '/winglinks/link/device/validationFindOneByDeviceIdentification/' + deviceIdentification,
    method: 'get'
  })
}

export function validationFindOneByClientId(clientId) {
  return request({
    url: '/winglinks/link/device/validationFindOneByClientId/' + clientId,
    method: 'get'
  })
}

export function getDeviceInfoByDeviceIdentification(deviceIdentification) {
  return request({
    url: '/winglinks/link/device/selectDeviceInfoByDeviceIdentification/' + deviceIdentification,
    method: 'get'
  })
}
